<div class="change-Passowrd"> 
    <p class="validateTips"></p>
    
        <table width="100%" border="0" cellspacing="0" cellpadding="0">

            <tr>  <td><label for="password"><strong style="font-size:11px;">Password:</strong><span class="requre">*</span></label></td>
                <td>&nbsp;</td>
                <td><input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
                    <div class="errorMessage2"></div></td>
            </tr>
            <tr>
                <td><label for="repassword"><strong style="font-size:11px;">Re-Type Password:</strong><span class="requre">*</span></label></td>
                <td>&nbsp;</td>
                <td><input type="password" name="repassword" id="repassword" value="" class="text ui-widget-content ui-corner-all" />
                    <div class="errorMessage1"></div></td>
            </tr>
            <tr>
                <td></td>
                <td>&nbsp;</td>
                <td><input type="submit" name="submit" id="submit" value="Save" class="btn btn btn-primary" /></td>
            </tr>
        </table>
 
</div>
<style>
    .ui-dialog 
    {width: 480px!important;top: 176px!important;left: 335px!important;}
    .requre,.errorMessage1,.errorMessage2{color: red;}

</style>
<script>
    $("#submit").click(function(){
        var password=$("#password").val();
        var repassword=$("#repassword").val();
        if(password==''){
            $(".errorMessage2").text('Enter the password');
            return false;
        }
        else if(repassword==''){
            $(".errorMessage").hide();
            $(".errorMessage1").text('Enter the repassword');
            return false;
        }
        else if(password!=repassword){
            $(".errorMessage").hide();
            $(".errorMessage1").text('Password do not match retypepassword');
            return false;
        }
        else{
            $.post("<?php echo Controller::createUrl('Users/ChangePassword'); ?>", {password:password,user_id:<?php echo $model->id;?>},
            function(result) {
                $(".ui-dialog").hide();
               $(".alert-success").show();
            });
        }
    })
</script>